package com.interview.rtc.aigc.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class VoiceChatRequestVO {
    private String AppId;
    private String RoomId;
    private String TaskId;
    private AgentConfig AgentConfig;
    private Config Config;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AgentConfig {
        private String UserId;
        private String WelcomeMessage;
        private boolean EnableConversationStateCallback;
        private String ServerMessageSignatureForRTS;
        private List<String> TargetUserId;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Config {
        private LLMConfig LLMConfig;
        private TTSConfig TTSConfig;
        private ASRConfig ASRConfig;
        private int InterruptMode;
        private SubtitleConfig SubtitleConfig;

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class LLMConfig {
            private String Mode;
            private String EndPointId;
            private int MaxTokens;
            private double Temperature;
            private double TopP;
            private List<String> SystemMessages;
            private List<String> UserMessages;
            private int HistoryLength;
            private boolean Prefill;
            private String ModelName;
            private String ModelVersion;
            private String WelcomeSpeech;
            private String ModeSourceType;
            private String APIKey;
            private String Url;
            private String Feature;
        }

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class TTSConfig {
            private String Provider;
            private ProviderParams ProviderParams;
            private List<Integer> IgnoreBracketText;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            public static class ProviderParams {
                private App app;
                private Audio audio;

                @Data
                @AllArgsConstructor
                @NoArgsConstructor
                public static class App {
                    private String AppId;
                    private String Cluster;
                }

                @Data
                @AllArgsConstructor
                @NoArgsConstructor
                public static class Audio {
                    private String voice_type;
                    private double speed_ratio;
                }
            }
        }

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class ASRConfig {
            private String Provider;
            private ASRProviderParams ProviderParams;
            private VADConfig VADConfig;
            private double VolumeGain;

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            public static class ASRProviderParams {
                private String Mode;
                private String AppId;
                private String Cluster;
            }

            @Data
            @AllArgsConstructor
            @NoArgsConstructor
            public static class VADConfig {
                private int SilenceTime;
                private int SilenceThreshold;
            }
        }

        @Data
        @AllArgsConstructor
        @NoArgsConstructor
        public static class SubtitleConfig {
            private int SubtitleMode;
        }
    }
}
